3.14 \(\int \frac{\csc (x)}{a+b \cos ^2(x)} \, dx\)

Optimal. Leaf size=42 \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b} \]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Cos[x])/Sqrt[a]])/(Sqrt[a]*(a + b))) - ArcTanh[Cos[x]]/(a + b)

________________________________________________________________________________________

Rubi [A]  time = 0.0491304, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {3190, 391, 206, 205} \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b} \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + b*Cos[x]^2),x]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Cos[x])/Sqrt[a]])/(Sqrt[a]*(a + b))) - ArcTanh[Cos[x]]/(a + b)

Rule 3190

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 391

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc (x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (x)\right )}{a+b}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\cos (x)\right )}{a+b}\\ &=-\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)}-\frac{\tanh ^{-1}(\cos (x))}{a+b}\\ \end{align*}

Mathematica [A]  time = 0.0469493, size = 50, normalized size = 1.19 \[ \frac{-\frac{2 \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \cos (x)}{\sqrt{a}}\right )}{\sqrt{a}}+\log (1-\cos (x))-\log (\cos (x)+1)}{2 (a+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + b*Cos[x]^2),x]

[Out]

((-2*Sqrt[b]*ArcTan[(Sqrt[b]*Cos[x])/Sqrt[a]])/Sqrt[a] + Log[1 - Cos[x]] - Log[1 + Cos[x]])/(2*(a + b))

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 56, normalized size = 1.3 \begin{align*} -{\frac{\ln \left ( 1+\cos \left ( x \right ) \right ) }{2\,a+2\,b}}+{\frac{\ln \left ( \cos \left ( x \right ) -1 \right ) }{2\,a+2\,b}}-{\frac{b}{a+b}\arctan \left ({b\cos \left ( x \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+b*cos(x)^2),x)

[Out]

-1/(2*a+2*b)*ln(1+cos(x))+1/(2*a+2*b)*ln(cos(x)-1)-b/(a+b)/(a*b)^(1/2)*arctan(b*cos(x)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.78181, size = 329, normalized size = 7.83 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a}} \log \left (\frac{b \cos \left (x\right )^{2} - 2 \, a \sqrt{-\frac{b}{a}} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) - \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )}}, -\frac{2 \, \sqrt{\frac{b}{a}} \arctan \left (\sqrt{\frac{b}{a}} \cos \left (x\right )\right ) + \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) - \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/a)*log((b*cos(x)^2 - 2*a*sqrt(-b/a)*cos(x) - a)/(b*cos(x)^2 + a)) - log(1/2*cos(x) + 1/2) + log(
-1/2*cos(x) + 1/2))/(a + b), -1/2*(2*sqrt(b/a)*arctan(sqrt(b/a)*cos(x)) + log(1/2*cos(x) + 1/2) - log(-1/2*cos
(x) + 1/2))/(a + b)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)**2),x)

[Out]

Integral(csc(x)/(a + b*cos(x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.20055, size = 68, normalized size = 1.62 \begin{align*} -\frac{b \arctan \left (\frac{b \cos \left (x\right )}{\sqrt{a b}}\right )}{\sqrt{a b}{\left (a + b\right )}} - \frac{\log \left (\cos \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} + \frac{\log \left (-\cos \left (x\right ) + 1\right )}{2 \,{\left (a + b\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

-b*arctan(b*cos(x)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - 1/2*log(cos(x) + 1)/(a + b) + 1/2*log(-cos(x) + 1)/(a + b)